package com.zoffy.ybuhelper.pojo.entity;

import androidx.annotation.NonNull;
import androidx.room.*;

@Entity(tableName = "menu",
        foreignKeys = @ForeignKey(
                entity = Origin.class,
                parentColumns = "id",
                childColumns = "origin_id",
                onDelete = ForeignKey.CASCADE
        ),
        indices = {@Index("origin_id")})
public class Menu {
    @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name = "id",typeAffinity = ColumnInfo.INTEGER)
    private Integer id;
    private String name;
    @ColumnInfo(name="deleted",typeAffinity = ColumnInfo.INTEGER,defaultValue = "0")
    private Integer deleted=0;
    @NonNull
    @ColumnInfo(name="origin_id",typeAffinity = ColumnInfo.INTEGER)
    private Integer originId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getOriginId() {
        return originId;
    }

    public void setOriginId(Integer originId) {
        this.originId = originId;
    }
}
